import { ref } from 'vue'

/**
 * 描述：深拷贝hooks
 * @date 2023-01-27
 * @param {any} data:any
 * @returns {any} deepClone 深拷贝方法
 *  @returns {any} clonedData 深拷贝的内容
 */
export const useDeepClone = (data: any) => {
  const clonedData = ref(null)
  const deepClone = () => {
    clonedData.value = JSON.parse(JSON.stringify(data))
  }
  return {
    clonedData,
    deepClone
  }
}
